package collection.map;

import collection.Printer;
import org.junit.Test;

import java.util.Map;
import java.util.concurrent.ConcurrentSkipListMap;

/**
 * 1.继承自AbstractMap，基于hash算法
 * 2.不支持null键和null值
 * 3.线程安全（）实现ConcurrentNavigableMap接口
 * 4.有序（底层是通过跳表来实现）
 */
public class ConcurrentSkipListMapTest {
    @Test
    public void testAdd() {
        Map<String, String> map = new ConcurrentSkipListMap<String, String>();

        map.put("1", "111");
        map.put("2", "");
        map.put("", "3");
        map.put("0", "0");
        map.put("9", "9");
        map.put("8", "8");
        Printer.printMap(map);

        map.get("1");
    }
}
